#ifndef OPTIONSET_H
#define OPTIONSET_H

#include <QComboBox>
#include <QObject>
#include <QMap>
#include <QDebug>
#include <QSerialPort>
class OptionSet:public QObject
{
    Q_OBJECT
public:
    typedef struct _OptionSetStruct
    {
        QString text;
        QVariant var;
    }OptionSetStruct;

    enum OptionType{
        SP_BaudRate,
        SP_DataBits,
        SP_Parity,
        SP_StopBits
    };

    OptionSet(QObject *parent = nullptr);
    static QList<OptionSet::OptionSetStruct> getOptionList(int option_type)
    {
        return  _optionMap[option_type];
    }
    static int initComboBox(QComboBox *cmb,int option_type);


private:
    static const QMap<int,QList<OptionSetStruct>> _optionMap;
};

#endif // OPTIONSET_H
